<template>
  <div class="updatePassword">
    <van-field v-model="account" type="password" placeholder="请输入账号" />

    <van-field type="password" v-model="password" placeholder="请输入密码" />
    <van-button
      type="info"
      @click="onSubmit"
      block
      round
      style="margin-top:50px;"
      >确认授权
    </van-button>
  </div>
</template>

<script>
import Vue from "vue";
import { Dialog } from "vant";
import { Image as VanImage } from "vant";
import { Notify } from "vant";

import { Button, Form, Field } from "vant";

Vue.use(Button)
  .use(Form)
  .use(Field);
import apiMar from "@/api/api";
Vue.use(VanImage);
Vue.use(Dialog);
export default {
  components: {},
  data() {
    return {
      password: "",
      password2: ""
    };
  },
  computed: {},
  watch: {},
  methods: {
    getData(values) {
      console.log("submit", values);
      this.submitBtn = true;
      let token = this.$tool.loadPageVar("token");
      let code = this.$tool.loadPageVar("auth_code");

      let params = {
        token,
        code
      };

      apiMar
        .oauthCode(params)
        .then(res => {
          console.log(res, "授权陈工");
        })
        .catch(err => {
          // this.$Message.error(err)
        });
    }
  },
  created() {
    this.getData();
  },

  mounted() {}
};
</script>
<style lang="scss" scoped>
.updatePassword {
  padding: 50px 40px 0;
}
</style>
